/*
var Cc = Components.classes;
var Ci = Components.interfaces;
var cons = Cc["@mozilla.org/consoleservice;1"].getService(Ci.nsIConsoleService);

function logMessage(str) {
	cons && cons.logStringMessage(str);
}
*/

var dynamicAttacherObj;

function onInit( ) {
	dynamicAttacherObj = document.getElementById('DynamicAttacher');
	
	var item1 = new BarChartItem('Cow', 900);
	var item2 = new BarChartItem('Dog', 500);
	var item3 = new BarChartItem('Cat', 1000);
	var item4 = new BarChartItem('Human', 11000);

	var graph = new BarGraph('theGraph');
	graph.Add(item1);
	graph.Add(item2);
	graph.Add(item3);
	graph.Add(item4);

	graph.SetHeight(500);
	graph.SetWidth(500);

	// graphics.ShowOutline = true;
	
	graph.Title = 'uhh, I donno...';

	graph.SetTitleLocation(10, 10);

	graph.ShowGraphBorder = true;
	graph.GraphBorder = Border.ThreeD;
	graph.GraphBorderColor = '#00979C';

	graph.ShowGrid = true;
	graph.BarBorder = Border.ThreeD;
	graph.GridStyle = Border.Dotted;
	graph.GridColor = '#335';

	graph.ShowShadow = false;
	graph.ShadowColor = Color.Green;
	graph.ShadowXOffset = 3;
	graph.ShadowYOffset = 3;

	graph.BarThickness = 100;
	graph.BarWidth = 10;
	graph.Label = ' Hz';

	graph.ShowValues = true;
	graph.ValueFont = new Font('Arial', '9pt', '#333');

	graph.ShowText = true;
	graph.NameFont = new Font('Arial', '9pt', '#333');

	graph.ShowTitle = true;
	graph.TitleFont = new Font('Arial', '9pt', '#333');

	graph.Generate( );

	graph.SetLocation(0, 30);
	
	graph.Attach(dynamicAttacherObj);

	AddMovement(dynamicAttacherObj);
}

if(window.addEventListener) {
	window.addEventListener('load', function(evt) {
		onInit( );
	}, false);
}
else if(window.attachEvent) {
	window.attachEvent('onload', function(evt) {
		onInit( );
	});
}